{$header} 
{$menu}
{$tiny}
{literal}
<script type="text/javascript" language="javascript">
	function getXMLHTTP() { //fuction to return the xml http object
        var xmlhttp=false;    
        try{
            xmlhttp=new XMLHttpRequest();
        }
        catch(e)    {        
            try{            
                xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                try{
                req = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch(e1){
                    xmlhttp=false;
                }
            }
        }

        return xmlhttp;
    }


    function getcate(strURL)
    {       
     var req = getXMLHTTP(); // fuction to get xmlhttp object
     if (req)
     {
      req.onreadystatechange = function()
     {
      if (req.readyState == 4) { //data is retrieved from server
       if (req.status == 200) { // which reprents ok status                    
         document.getElementById('citydiv').innerHTML=req.responseText;
      }
      else
      { 
         alert("There was a problem while using XMLHTTP:\n");
      }
      }            
      }        
    req.open("GET", strURL, true); //open url using get method
    req.send(null);
     }
    }
</script>

{/literal}
<div id="content">
    <div id="tab" class="radius-top">Product &gt;&gt; Add
        <div class="clear"></div></div>
		{$form_open}             
        <table>
              <tbody>
              <tr>
                  <td align="left">Status&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo">
                  <input type="radio" value="1" name="status">
                  Active<input type="radio" value="0" name="status">Inactive <span class="errors">{$errorstatus}</span></td>
                </tr>
              
                <tr>
                  <td align="left">Customer&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo">
                  <select name="customer" onChange="getcate('{$url}manage_product/cate_no/'+this.value)">
                    {$customer}
                   </select>
                   <span class="errors">{$errorcustomer}</span>
                  </td>
                </tr>
               <tr>
                  <td align="left">Category&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo">
                   <div id="citydiv">
                     <select name="category">
                     	<option value="">Select Category</option>
                     </select>
                     <span class="errors">{$errorcategory}</span>    
 					</div></td>
                </tr>
                <tr>
                  <td align="left">Model / Code&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo"><input type="text" name="code" id="txtCategory5" value="{$code}" />
                  <span class="errors">{$errorcode}</span>
                  </td>
                </tr>
                <tr>
                  <td align="left">Name En&nbsp;<span class="errors">*</span></td>
                  <td class="hotelInfo"><label for="txtCategory"></label>
                  <input type="text" name="title_en" id="txtCategory" value="{$title_en}" /><span class="errors">{$errortitle_en}</span></td>
                </tr>
                 <tr>
                  <td align="left"> Name Cn</td>
                  <td class="hotelInfo"><label for="txtCategory"></label>
                  <input type="text" name="title_cn" id="txtCategory" value="{$title_cn}" /></td>
                </tr>
                 <tr>
                  <td align="left"> Name Th</td>
                  <td class="hotelInfo"><label for="txtCategory"></label>
                  <input type="text" name="title_th" id="txtCategory" value="{$title_th}" /></td>
                </tr>
                 <tr>
                   <td align="left" valign="top">Description En&nbsp;<span class="errors">*</span></td>
                   <td class="hotelInfo">
                   
                   <textarea  id="elm1" name="desc_en" cols="45" rows="5">{$desc_en}</textarea><span class="errors">{$errordesc_en}</span></td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Description Cn</td>
                   <td class="hotelInfo"><textarea name="desc_cn"  id="elm2" cols="45" rows="5">{$desc_cn}</textarea></td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Description Th</td>
                   <td class="hotelInfo"><textarea name="desc_th"  id="elm3" cols="45" rows="5">{$desc_th}</textarea></td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Picture</td>
                   <td class="hotelInfo"><input type="file" name="pic" id="txtCategory6"  />
                   <span class="errors">{$errorpic}</span>
                   </td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Price&nbsp;<span class="errors">*</span></td>
                   <td class="hotelInfo"><input type="text" name="price" id="txtCategory2" value="{$price}" placeholder="0.00"  />
                   <span class="errors">{$errorprice}</span>
                   </td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Point gain&nbsp;<span class="errors">*</span></td>
                   <td class="hotelInfo"><input type="text" name="point_gain" id="txtCategory3" value="{$point_gain}" placeholder="0.00"  />
                   <span class="errors">{$errorpoint_gain}</span>
                    </td>
                 </tr>
                 <tr>
                   <td align="left" valign="top">Point_spend&nbsp;<span class="errors">*</span></td>
                   <td class="hotelInfo"><input type="text" name="point_spend" id="txtCategory4" value="{$point_spend}" placeholder="0.00"  />
                   <span class="errors">{$errorpoint_spend}</span>
                   </td>
                 </tr>
              </tbody>
            </table>
            <div id="bnt" class="mws-form-row">
              <input type="submit"  name="bntSubmit" class="mws-button green" value="Save"  />
                <input type="button" name="bntSubmit" class="mws-button green" value="Cancel" onclick="window.location='{$url}manage_product/product_list';" />
  </div>
		{$form_close}
  </div>
  {$footer}